import { createRouter, createWebHistory } from 'vue-router';

import login from '../pages/login.vue';
import reg from '../pages/reg.vue';
import BuyTickets from '../pages/BuyTickets.vue';
// import LtsPlaying from '../pages/app/HotScreen/LtsPlaying.vue';

const routes = [
  { path: '/', redirect: '/login', },
  { path: '/login', name: 'Login', component: login, },
  { path: '/register', name: 'Register', component: reg, },
  {
    path: '/home',
    name: 'BuyTickets',
    component: BuyTickets,
    redirect: '/home/BuyTickets',
    children: [
      // { path: '/home/BuyTickets', component: () => import('../pages/app/HotScreen.vue'), },
      {
        path: '/home/BuyTickets',
        // component: LtsPlaying,
        redirect: '/home/BuyTickets/LtsPlaying',
        children: [
          {
            path: '/home/BuyTickets/LtsPlaying', component: () => import('../pages/app/HotScreen/LtsPlaying.vue'),
          }, {
            path: '/home/BuyTickets/LtsPlaying', component: () => import('../pages/app/HotScreen/ComingSoon.vue'),
          },
        ]
      },
      { path: '/home/Cinema', component: () => import('../pages/app/CinemaVite.vue'), },
      { path: '/home/My', component: () => import('../pages/app/MyVite.vue'), },

    ]
  },
];

const router = createRouter({
  // history: createWebHashHistory(), // 路由模式，hash模式、history模式、memory模式
  history: createWebHistory(), // 历史模式
  routes // 路由中url和组件一一对应的映射数组
})
export default router;